load(
    "@org_tensorflow//tensorflow:tensorflow.bzl",
    "tf_cc_test",
)
load("@org_tensorflow//tensorflow:tensorflow.default.bzl", "get_compatible_with_portable")
load("@rules_cc//cc:cc_library.bzl", "cc_library")

package(
    # copybara:uncomment default_applicable_licenses = ["@org_tensorflow//tensorflow:license"],
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "cluster_utils",
    srcs = [
        "cluster_utils.cc",
    ],
    hdrs = [
        "cluster_utils.h",
    ],
    compatible_with = get_compatible_with_portable(),
)

cc_library(
    name = "cluster",
    srcs = [
        "cluster.cc",
    ],
    hdrs = [
        "cluster.h",
    ],
    compatible_with = get_compatible_with_portable(),
    deps = [
        ":cluster_utils",
        "//tflite/toco:model",
        "//tflite/toco:tooling_util",
        "@org_tensorflow//tensorflow/core:protos_all_cc",
    ],
)

cc_library(
    name = "resolve_svdf",
    srcs = [
        "resolve_svdf.cc",
    ],
    hdrs = [
        "resolve_svdf.h",
    ],
    compatible_with = get_compatible_with_portable(),
    visibility = ["//visibility:public"],
    deps = [
        ":cluster",
        ":cluster_utils",
        "//tflite/toco:model",
        "//tflite/toco:toco_port",
        "//tflite/toco:tooling_util",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@org_tensorflow//tensorflow/core:lib",
        "@org_tensorflow//tensorflow/core:protos_all_cc",
    ],
)

tf_cc_test(
    name = "resolve_svdf_test",
    srcs = ["resolve_svdf_test.cc"],
    deps = [
        ":cluster",
        ":cluster_utils",
        ":resolve_cluster",
        ":resolve_svdf",
        "//tflite/toco:toco_port",
        "@com_google_absl//absl/log:check",
        "@com_google_googletest//:gtest_main",
        "@org_tensorflow//tensorflow/core:lib",
        "@org_tensorflow//tensorflow/core:protos_all_cc",
    ],
)

cc_library(
    name = "resolve_cluster",
    srcs = [
        "resolve_cluster.cc",
    ],
    hdrs = [
        "resolve_cluster.h",
    ],
    compatible_with = get_compatible_with_portable(),
    visibility = ["//visibility:public"],
    deps = [
        ":cluster",
        ":cluster_utils",
        ":resolve_svdf",
        "@org_tensorflow//tensorflow/core:protos_all_cc",
    ],
)
